<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<script type="text/javascript">
		$(function(){
			init();
			var rows = $("#list_date").bootstrapTable('getSelections');
			//扫一次数据库 查询出来
			getById(rows[0].sys_dict_id);
		});
	 	//修改时 加载数据
	 	function getById(id){
	 		$.ajax({
	 			  data : {
	 				  "sys_dict_id" : id
	 			  },
	 			  type: "POST",
	 	          url: global_param.context_name+"/sys/getByDictId.do",
	 	          async: false,
	              dataType: "json",
	              success: function(json) {
	            	  $('#sys_dict_id').val(json.sys_dict_id);
					  $('#value_meaning').val(json.value_meaning);
	            	  $('#key_code').val(json.key_code);
	            	  $('#sort_order').val(json.sort_order);
	            	  $('#remark').val(json.remark);
	            	  $('#dict_level').val(json.dict_level);
	            	  $('#p_sys_dict_id').val(json.p_sys_dict_id);
	            	  $('#_parentId').val(json._parentId);
	              }
	 		});
	 	}
	 	
	 	function init(){
	 		$('#update_perm_form').bootstrapValidator({
		        feedbackIcons: {/*输入框不同状态，显示图片的样式*/
		            valid: 'glyphicon glyphicon-ok',
		            invalid: 'glyphicon glyphicon-remove',
		            validating: 'glyphicon glyphicon-refresh'
		        },
		        fields: {
		        	value_meaning:{
		                validators: {
		                    notEmpty: {
		                        message: '数据名称不能为空'
		                    }
		                }
		        	},
		        	key_code:{
		                validators: {
		                    notEmpty: {
		                        message: '数据编码不能为空'
		                    }
		                }
		        	},
		        	sort_order:{
		                validators: {
		                    notEmpty: {
		                        message: '排序序号不能为空'
		                    },
		                    regexp: {/* 只需加此键值对，包含正则表达式，和提示 */
		                        regexp: /^[0-9]+$/,
		                        message: '只能是数字!'
		                    }
		                }
		        	}
		        }
			});
	 	}
	</script>
</head>
<body>
	<form id="update_perm_form" method="post" >
	    <div class="form-group">
	        <label for="value_meaning">数据名称</label>
	        <input class="form-control" id="value_meaning" name="value_meaning"></input>
	    </div>	
	    <div class="form-group">
	        <label for="key_code">数据编码</label>
	        <input class="form-control" id="key_code" name="key_code"></input>
	    </div>
	    
	    <div class="form-group">
	        <label for="sort_order">排序序号</label>
	        <input class="form-control" id="sort_order" name="sort_order"></input>
	    </div>
	    
	    <div class="form-group">
	        <label for="remark">备注</label>
	        <textarea rows="5" class="form-control" id="remark" style="resize: none;"></textarea>
	    </div>
	    <input type="hidden" id="sys_dict_id" name="sys_dict_id"/>
		<input type="hidden" id="dict_level" name="dict_level"/>
		<input type="hidden" id="p_sys_dict_id" name="p_sys_dict_id"/>
		<input type="hidden" id="_parentId" name="_parentId"/>
	</form>
</body>
</html>